package com.zhuiyun.project.api.weightchangetable.controller;

import com.zhuiyun.project.annotation.OptLog;
import com.zhuiyun.project.api.weightchangetable.mapper.WeightChangeTableMapper;
import com.zhuiyun.project.api.weightchangetable.service.WeightChangeTableService;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.constants.CommonConstants;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName WeightChangeTableController
 * @Description TODO
 * @Author wuwan
 * @Date 2023/11/29 13:09
 **/
@RestController
@RequestMapping("/WeightChangeTable")
public class WeightChangeTableController {
    @Autowired
    WeightChangeTableService weightChangeTableService;

    /*
     * @Author wuwan
     * @Description 查询历史体重变化表
     * @Date 2023/11/21 15:32
     * @Return
     */
    @GetMapping("/selectUserWeightChangeTable")
    @ApiOperation(value = "查询历史体重变化表")
    @OptLog(modular = "学员端体重记录表",type = CommonConstants.SELECT,describe = "查询历史体重变化表")
    public CommonResult selectUserWeightChangeTable(Integer uid){
        return CommonResult.ok(weightChangeTableService.selectUserWeightChangeTable(uid));
    }
    /*
     * @Author wuwan
     * @Description 查询体脂率 bmi 体重
     * @Date 2023/11/21 15:32
     * @Return
     */
    @GetMapping("/selectUserChangeBmi")
    @ApiOperation(value = "查询体脂率 bmi 体重")
    @OptLog(modular = "学员端体重记录表",type = CommonConstants.SELECT,describe = "查询体脂率 bmi 体重")
    public CommonResult selectUserChangeBmi(Integer uid){
        return CommonResult.ok(weightChangeTableService.selectUserChangeBmi(uid));
    }
}
